<template>
    <div id="User">
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>用户管理</el-breadcrumb-item>
            <el-breadcrumb-item>用户列表</el-breadcrumb-item>
        </el-breadcrumb>
        <el-card class="box-card">
            <el-row :gutter="20">
                <el-col :span="7">
                    <el-input placeholder="请输入内容" class="input-with-select">
                        <el-button slot="append" icon="el-icon-search"></el-button>
                    </el-input>
                </el-col>
                <el-col :span="5">
                    <el-button type="primary">主要按钮</el-button>
                </el-col>
            </el-row>

            <template>
                <el-table :data="tableData" border style="width: 100%"  :stripe="true">
                    <el-table-column type="index" width="50"> </el-table-column>
                    <el-table-column prop="username" label="用户名" width="180"></el-table-column>
                    <el-table-column prop="email" label="邮箱" width="180"> </el-table-column>
                    <el-table-column prop="phone" label="手机号" width="180"> </el-table-column>
                    <el-table-column label="状态" width="180">
                        <template slot-scope="scope">
                            <el-switch
                                    v-model="scope.row.isSwitch"
                                    active-color="#13ce66"
                                    inactive-color="#ff4949">
                            </el-switch>
                        </template>

                    </el-table-column>
                    <el-table-column label="操作" width="180">
                        <el-button size="mini" type="primary" icon="el-icon-edit"></el-button>
                        <el-button size="mini" type="warning" icon="el-icon-star-off"></el-button>
                        <el-button size="mini" type="danger" icon="el-icon-delete"></el-button>
                    </el-table-column>
                </el-table>
            </template>

            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="currentPage"
                    :page-sizes="[1,2,5,10]"
                    :page-size="1"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="5">
            </el-pagination>
        </el-card>
    </div>
</template>

<script>
    export default {
        name: "User",
        data(){
            return{
                isSwitch:true,
                currentPage : 1,
                tableData: [{
                    username:'jankin',
                    email:"18506463256@qq.com",
                    phone:"18506463256",
                    isSwitch:true
                },{
                    username:'whwyz',
                    email:"15523658569@qq.com",
                    phone:"15523658569",
                    isSwitch:false
                }]
            }
        },
        methods:{
            handleSizeChange(){

            },
            handleCurrentChange(){

            }
        }
    }
</script>

<style scoped>

</style>
